using System;
using System.Globalization;
using System.Windows.Data;

namespace PCR.Converter
{
	public class TimeChangeViewConverter : IMultiValueConverter
	{
		public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
		{
			int result = 0;
			int.TryParse(values[0].ToString(), out result);
			double result2 = 0.0;
			double.TryParse(values[1].ToString(), out result2);
			if (result == 0)
			{
				return string.Format(" {0}{1}s", "+", result2);
			}
			return string.Format(" {0}{1}s", "-", result2);
		}

		public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
		{
			return null;
		}
	}
}
